package com.QK.cnstudy.entity;

import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;

public class Stat {
    Integer study_work_num;
    Integer read_num;
    Integer study_time;
    Integer test_num;
    Integer test_subject_num;
    Integer test_wrong_subject_num;
    Integer use_hint_num;
    Integer last_test_time;

    public void setInfoFromCursor(Cursor cursor) {
        int tmp;
        if ((tmp = cursor.getColumnIndex("study_work_num")) != -1) {
            setStudy_work_num(cursor.getInt(tmp));
        }
        if ((tmp = cursor.getColumnIndex("read_num")) != -1) {
            setRead_num(cursor.getInt(tmp));
        }
        if ((tmp = cursor.getColumnIndex("study_time")) != -1) {
            setStudy_time(cursor.getInt(tmp));
        }
        if ((tmp = cursor.getColumnIndex("test_num")) != -1) {
            setTest_num(cursor.getInt(tmp));
        }
        if ((tmp = cursor.getColumnIndex("test_subject_num")) != -1) {
            setTest_subject_num(cursor.getInt(tmp));
        }
        if ((tmp = cursor.getColumnIndex("test_wrong_subject_num")) != -1) {
            setTest_wrong_subject_num(cursor.getInt(tmp));
        }
        if ((tmp = cursor.getColumnIndex("last_test_time")) != -1) {
            setLast_test_time(cursor.getInt(tmp));
        }

        if ((tmp = cursor.getColumnIndex("use_hint_num")) != -1) {
            setUse_hint_num(cursor.getInt(tmp));
        }

    }

    public void saveToDB(SQLiteDatabase sqLiteDatabase) {
        sqLiteDatabase.execSQL("insert into work values (?,?,?,?,?,?,?,?)", new Object[] { getStudy_work_num(),
                        getRead_num(), getStudy_time(), getTest_num(), getTest_subject_num(),
                        getTest_wrong_subject_num(), getUse_hint_num(), getLast_test_time() });
    }

    public Integer getStudy_work_num() {
        return study_work_num;
    }

    public void setStudy_work_num(Integer study_work_num) {
        this.study_work_num = study_work_num;
    }

    public Integer getRead_num() {
        return read_num;
    }

    public void setRead_num(Integer read_num) {
        this.read_num = read_num;
    }

    public Integer getStudy_time() {
        return study_time;
    }

    public void setStudy_time(Integer study_time) {
        this.study_time = study_time;
    }

    public Integer getTest_num() {
        return test_num;
    }

    public void setTest_num(Integer test_num) {
        this.test_num = test_num;
    }

    public Integer getTest_subject_num() {
        return test_subject_num;
    }

    public void setTest_subject_num(Integer test_subject_num) {
        this.test_subject_num = test_subject_num;
    }

    public Integer getTest_wrong_subject_num() {
        return test_wrong_subject_num;
    }

    public void setTest_wrong_subject_num(Integer test_wrong_subject_num) {
        this.test_wrong_subject_num = test_wrong_subject_num;
    }

    public Integer getUse_hint_num() {
        return use_hint_num;
    }

    public void setUse_hint_num(Integer use_hint_num) {
        this.use_hint_num = use_hint_num;
    }

    public Integer getLast_test_time() {
        return last_test_time;
    }

    public void setLast_test_time(Integer last_test_time) {
        this.last_test_time = last_test_time;
    }

}
